package com.qf.controller;

import com.qf.dto.PageSearchDTO;
import com.qf.entity.MallGoods;
import com.qf.entity.ViewGoods;
import com.qf.service.IGoodsService;
import com.qf.vo.PageResult;
import com.qf.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>title: com.qf.controller</p>
 * <p>Company: wendao</p>
 * author zhuximing
 * date 2021/9/18
 * description:
 */
@RestController
@CrossOrigin
@RequestMapping("goods")
public class GoodController {
    @Autowired
    private IGoodsService goodsService;

    @PostMapping("page")
    public PageResult<ViewGoods> page(@RequestBody PageSearchDTO<MallGoods> dto){


        return goodsService.selectByPage(dto);

    }
    @PostMapping("delGood")
    public Result delGood(@RequestBody ViewGoods viewGoods){

        return goodsService.delete(viewGoods);

    }

}